---
title: Native automation - overview
---

Flutter's [integration_test][integration_test] does a good job at providing
basic support for integration testing Flutter apps. What it can't do is
interaction with the OS your Flutter app is running on. This makes it impossible
to test many critical business features:

- granting runtime permissions
- signing into the app which uses WebView or 0Auth (like Google) as the login
  page
- listing and tapping on notifications
- exiting the app, coming back, and verifying that state is preserved
- enabling and disabling features such as Wi-Fi, mobile data, location, or dark
  mode

Patrol's _native automation_ feature finally solves these problems. Here's a
tiny snippet to spice things up:

```dart title="patrol_test/demo_test.dart"
void main() {
  patrolTest('demo', (PatrolIntegrationTester $) async {
    await $.pumpWidgetAndSettle(AwesomeApp());
    // prepare network conditions
    await $.native.enableCellular();
    await $.native.disableWifi();

    // toggle system theme
    await $.native.enableDarkMode();

    // handle native location permission request dialog
    await $.native.selectFineLocation();
    await $.native.grantPermissionWhenInUse();

    // tap on the first notification
    await $.native.openNotifications();
    await $.native.tapOnNotificationByIndex(0);
  });
}
```

<Info>Native automation is currently available only on Android and iOS.</Info>

<Tweet id="1592464714227142658" />

<Tweet id="1600058780724523009" />

[integration_test]: https://github.com/flutter/flutter/tree/master/packages/integration_test
